package cn.co4;

public class Ex2 {
	public static void main(String args[]) {
		try {
			int a = 0;
			int b = 42 / a;
			int c[] = {1};
			c[2] = 99;
		}catch(ArithmeticException e) {
			System.out.println("发生了被0除" + e);
		}catch(ArrayIndexOutOfBoundsException e1) {
			System.out.println("数组下标越界" + e1);
		}finally {
			System.out.println("finally 语句被执行");
		}
	}
}

